package com.qf.openapi.web.master.controller;

import com.qf.openapi.web.master.entity.User;
import com.qf.openapi.web.master.service.UserSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private UserSevice userSevice;



    @GetMapping("/test1")
    public String test1(){
        return "hello mvc";
    }


    @GetMapping("/get/{id}")
    public User getUser(@PathVariable("id") Integer id){
        return userSevice.getUser(id);
    }

}
